﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using BLL;

public partial class Glnmxcx1 : System.Web.UI.Page
{
    int unit;
    string strApp = "";
    public static string repName = "";
    public string bmp = "";

    BLL.BLLRep br = new BLLRep();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["repName"].ToString() != "")
        {
            repName = Request.QueryString["repName"].ToString();
            unit = int.Parse(Request.QueryString["unit"].ToString());

            bmp = Request.QueryString["repName"].ToString() + "nmx" + unit + ".bmp";
        }
        if (!IsPostBack)
        {
            DateTime dt = System.DateTime.Now;

            this.Date1.Value = dt.ToString("yyyy");

            string date = this.Date1.Value + "-01-01 00:00:00";

            strApp = br.RetTableByYearInfo(repName, unit, Convert.ToDateTime(date));

            this.show.InnerHtml = strApp;
        }
    }
    protected void btnChaXun_Click(object sender, EventArgs e)
    {
        DateTime dtInput = Convert.ToDateTime(this.Date1.Value + "-01-01 00:00:00");

        strApp = br.RetTableByYearInfo(repName, unit, dtInput);

        this.show.InnerHtml = strApp;
    }

    protected void btnPre_Click(object sender, EventArgs e)
    {
        //Response.Write("Pre");

        DateTime dtInput = Convert.ToDateTime(this.Date1.Value + "-01-01 00:00:00").AddYears(-1);

        this.Date1.Value = Convert.ToDateTime(this.Date1.Value + "-01-01 00:00:00").AddYears(-1).ToString("yyyy");

        strApp = br.RetTableByYearInfo(repName, unit, dtInput);

        this.show.InnerHtml = strApp;
    }

    protected void btnNext_Click(object sender, EventArgs e)
    {
        //Response.Write("Next");

        DateTime dtInput = Convert.ToDateTime(this.Date1.Value + "-01-01 00:00:00").AddYears(+1);

        this.Date1.Value = Convert.ToDateTime(this.Date1.Value + "-01-01 00:00:00").AddYears(+1).ToString("yyyy");

        strApp = br.RetTableByYearInfo(repName, unit, dtInput);

        this.show.InnerHtml = strApp;
    }
}
